React 19.1 captureOwnerStack#146
Conversation
src/React.res
Outdated
| external act: (unit => promise<unit>) => promise<unit> = "act" | ||
|
|
||
| @module("react") | ||
| external captureOwnerStack: unit => Js.nullable<string> = "captureOwnerStack" |
There was a problem hiding this comment.
If I understood the API, it should return null or string, so either use a @return or Null.t.
There was a problem hiding this comment.
I didn't know this decorator, thanks!
cddbda2 to
9d612c9
Compare
| external act: (unit => promise<unit>) => promise<unit> = "act" | ||
|
|
||
| @module("react") @return(nullable) | ||
| external captureOwnerStack: unit => option<string> = "captureOwnerStack" |
There was a problem hiding this comment.
Nitpick: add a doc comment with link to https://react.dev/reference/react/captureOwnerStack
There was a problem hiding this comment.
Is there a way to format it? I don't see any other comment with link to the react doc.
There was a problem hiding this comment.
Doesn't mean you shouldn't add it.
Try something like /** url */
src/React.res
Outdated
| @module("react") | ||
| external act: (unit => promise<unit>) => promise<unit> = "act" | ||
|
|
||
| @module("react") @return(nullable) |
There was a problem hiding this comment.
Actually @return(null_to_opt) would make the intention clearer as the API can only return string or null according to the docs (but not undefined).
|
Sorry for the delay, I updated the PR. |
|
Hi @cknitt, |
|
@Freddy03h Fine with me to merge now! Thanks! |
It seems
capureOwnerStackis the only new API in React 19.1 : https://github.com/facebook/react/releases/tag/v19.1.0📖 captureOwnerStack Documentation
Maybe it's possible to have a release for 19.1 before working on React 19.2 new APIs